<!DOCTYPE html>
<html>
<head th:include="common/header_css::header('霸王餐小程序后台管理-','%mfile')"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox float-e-margins">
        <div th:replace="common/toolbar::toolbar('管理')"></div>
        <div th:replace="common/search::search('%add')"></div>
    </div>
</div>

<!--添加Hdtemplate模态框-->
<div id="modal-add-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <h3 class="m-t-none m-b">添加</h3>
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-content">
                                <form id="aform" method="post" class="form-horizontal" action="add"
                                      onsubmit="return checkAdd()">
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">模板名称</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="title" type="text" maxlength="200"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">营销功能</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="yxtags" type="text" maxlength="200"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">行业类别</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" id="type2" name="type" onchange="typechange(2)">
                                                        <option value="">请选择</option>
                                                        <option value="jianshen">健身</option>
                                                        <option value="canyin">美食</option>
                                                        <option value="meirongmeifa">美容</option>
                                                        <option value="xiuxianyule">休闲</option>
                                                        <option value="muyin">母婴</option>
                                                        <option value="fuzhuang">服装</option>
                                                        <option value="mianbao">面包</option>
                                                        <option value="shanchaobianli">商超</option>
                                                        <option value="baihuo">百货</option>
                                                        <option value="shucaishuiguo">水果</option>
                                                        <option value="zhubao">珠宝</option>
                                                        <option value="jiancaijiaju">建材</option>
                                                        <option value="jiaoyupeixun">教育</option>
                                                        <option value="qiche">汽车</option>
                                                        <option value="yanjing">眼镜</option>
                                                        <option value="zhuangxiu">装修</option>
                                                        <option value="jiazheng">家政</option>
                                                        <!--<option value="zhinengchanpin">智能</option>-->
                                                        <!--<option value="lvyou">旅游</option>-->
                                                        <!--<option value="shangwufuwu">商务</option>-->
                                                        <!--<option value="jiuleichaye">酒茶</option>-->
                                                        <!--<option value="yiyaoqixie">医药</option>-->
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">营销类型</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" id="yxtype2" name="yxtype"  onchange="yxtypechange(2)">
                                                        <option value="">请选择</option>
                                                        <option value="1">拼团</option>
                                                        <option value="2">砍价</option>
                                                        <option value="3">抽奖</option>
                                                        <option value="7">大礼包</option>
                                                        <option value="8">秒杀</option>
                                                        <option value="9">报名</option>
                                                        <option value="10">投票</option>
                                                        <option value="13">集赞</option>
                                                        <option value="14">发优惠券</option>
                                                        <option value="15">推荐有礼</option>
                                                        <option value="16">红包裂变券</option>
                                                        <option value="17">会员裂变</option>
                                                        <option value="18">群发红包裂变</option>
                                                        <option value="24">朋友圈转发</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">模板图</label>
                                                <div class="col-sm-10">
                                                    <input id="mfilepic2" name="mfile" type="file" class="file"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">订单数</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="orders" type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">销售额</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="xiaohsou" type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">客户数</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="users" type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">使用商家数</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="uses" type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">活动ID</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="users" type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商家ID</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="sid" type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">关联业务ID</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="ywid" type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label"></label>
                                                <div class="col-sm-8">

                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">玩法介绍</label>
                                                <div class="col-sm-10">
                                                     <textarea class="form-control" name="info" maxlength="2000"></textarea>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">活动效果图
                                                </label>
                                                <div class="col-sm-10">
                                                    <input id="mfilephotos2" name="mfile" type="file" multiple class="file"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-4 col-sm-offset-2">
                                            <button class="btn btn-primary" type="submit">保存内容</button>
                                            <button data-toggle="modal" type="button" class="btn btn-white"
                                                    href="#modal-add-form">取消
                                            </button>
                                        </div>
                                    </div>
                                    <input id="hidpic2" name="pic" type="hidden" value=""/>
                                    <input id="hidphotos2" name="photos" type="hidden" value=""/>
                                    <input id="hidtypename2" name="typename" type="hidden" value=""/>
                                    <input id="hidyxname2" name="yxname" type="hidden" value=""/>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!--修改Hdtemplate模态框-->
<div id="modal-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <h3 class="m-t-none m-b">修改</h3>
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-content">
                                <form id="mform" method="post" class="form-horizontal" action="modify"
                                      onsubmit="return checkModify()">
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">模板名称</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="title" name="title"
                                                           type="text" maxlength="200"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">营销功能</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="yxtags" name="yxtags"
                                                           type="text" maxlength="200"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">行业类别</label>
                                                <div class="col-sm-8">
                                                    <select id="type" class="form-control" id="type" name="type" onchange="typechange()">
                                                        <option value="">请选择</option>
                                                        <option value="jianshen">健身</option>
                                                        <option value="canyin">美食</option>
                                                        <option value="meirongmeifa">美容</option>
                                                        <option value="xiuxianyule">休闲</option>
                                                        <option value="muyin">母婴</option>
                                                        <option value="fuzhuang">服装</option>
                                                        <option value="mianbao">面包</option>
                                                        <option value="shanchaobianli">商超</option>
                                                        <option value="baihuo">百货</option>
                                                        <option value="shucaishuiguo">水果</option>
                                                        <option value="zhubao">珠宝</option>
                                                        <option value="jiancaijiaju">建材</option>
                                                        <option value="jiaoyupeixun">教育</option>
                                                        <option value="qiche">汽车</option>
                                                        <option value="yanjing">眼镜</option>

                                                        <option value="zhuangxiu">装修</option>
                                                        <option value="jiazheng">家政</option>
                                                        <!--<option value="zhinengchanpin">智能</option>-->
                                                        <!--<option value="lvyou">旅游</option>-->
                                                        <!--<option value="shangwufuwu">商务</option>-->
                                                        <!--<option value="jiuleichaye">酒茶</option>-->
                                                        <!--<option value="yiyaoqixie">医药</option>-->
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">营销类型</label>
                                                <div class="col-sm-8">
                                                    <select id="yxtype" class="form-control" id="yxtype" name="yxtype"  onchange="yxtypechange()">
                                                        <option value="">请选择</option>
                                                        <option value="1">拼团</option>
                                                        <option value="2">砍价</option>
                                                        <option value="3">抽奖</option>
                                                        <option value="7">大礼包</option>
                                                        <option value="8">秒杀</option>
                                                        <option value="9">报名</option>
                                                        <option value="10">投票</option>
                                                        <option value="13">集赞</option>
                                                        <option value="14">发优惠券</option>
                                                        <option value="15">推荐有礼</option>
                                                        <option value="16">红包裂变券</option>
                                                        <option value="17">会员裂变</option>
                                                        <option value="18">群发红包裂变</option>
                                                        <option value="24">朋友圈转发</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">模板图</label>
                                                <div class="col-sm-10">
                                                    <input id="mfilepic" name="mfile" type="file" multiple class="file"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">订单数</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="orders" name="orders"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">销售额</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="xiaohsou" name="xiaohsou"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">客户数</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="users" name="users" type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">使用商家数</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="uses" name="uses" type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">活动ID</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="gid" name="gid" type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商家ID</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="sid" name="sid" type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">关联业务ID</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="ywid" name="ywid" type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label"></label>
                                                <div class="col-sm-8">

                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">玩法介绍</label>
                                                <div class="col-sm-10">
                                                            <textarea id="info" name="info" class="form-control"
                                                                      maxlength="2000" ></textarea>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">活动效果图
                                                </label>
                                                <div class="col-sm-10">
                                                    <input id="mfilephotos" name="mfile" type="file" multiple class="file"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-4 col-sm-offset-2">
                                            <button class="btn btn-primary" type="submit">保存内容</button>
                                            <button data-toggle="modal" type="button" class="btn btn-white"
                                                    href="#modal-form">取消
                                            </button>
                                        </div>
                                    </div>
                                    <input id="hidpic" name="pic" type="hidden" value=""/>
                                    <input id="hidphotos" name="photos" type="hidden" value=""/>
                                    <input id="hidtypename" name="typename" type="hidden" value=""/>
                                    <input id="hidyxname" name="yxname" type="hidden" value=""/>
                                    <input id="id" name="id" type="hidden" value=""/>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:include="common/footer_js::footer"></div>
<script>

    function typechange(n) {
        var hids='hidtypename'+''+(n?n:'')
        var ids='type'+''+(n?n:'')
        console.log("--------------typechange")
        console.log("--------------hids="+hids)
        console.log("--------------ids"+ids)
        $("#"+hids).val($('#'+ids).find("option:selected").text())
    }

    function yxtypechange(n) {
        var hids='hidyxname'+''+(n?n:'')
        var ids='yxtype'+''+(n?n:'')
        console.log("--------------yxtypechange")
        console.log("--------------hids="+hids)
        console.log("--------------ids"+ids)
        $("#"+hids).val($('#'+ids).find("option:selected").text())
    }

</script>
<script src="/js/admin/hdtemplate.js"></script>
</body>
</html>
